package com.lyy.lottery.service.dto;

import com.lyy.lottery.service.enums.ActivityPrizeStatusEnum;
import com.lyy.lottery.service.enums.ActivityPrizeTiersEnum;
import com.lyy.lottery.service.enums.ActivityStatusEnum;
import com.lyy.lottery.service.enums.ActivityUserStatusEnum;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Data
public class ActivityDetailDTO {

    //活动基本信息
    private Long activityId;
    private String activityName;
    private String desc;
    private ActivityStatusEnum status;
    public Boolean valid() {
        return status.equals(ActivityStatusEnum.RUNNING);
    }

    //关联奖品信息
    private List<PrizeDTO> prizeDTOList;
    //关联用户信息
    private List<UserDTO> userDTOList;


    @Data
    public static class PrizeDTO {
        private Long prizeId;
        private String name;
        private String imageUrl;
        private BigDecimal price;
        private String description;
        private ActivityPrizeTiersEnum tiers;
        private Long prizeAmount;
        private ActivityPrizeStatusEnum status;

        public Boolean valid() {
            return status.equals(ActivityPrizeStatusEnum.INIT);
        }
    }

    @Data
    public static class UserDTO {
        private Long userId;
        private String userName;
        private ActivityUserStatusEnum status;

        public Boolean valid() {
            return status.equals(ActivityUserStatusEnum.INIT);
        }
    }

}
